package selenium;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import pages.HomePage;
import util.ReportWriter;

public class SearchProduct extends TestConditions
{

    @DataProvider(name = "searchProduct")
    public Object[][] provideData()
    {
        return new Object[][]
                {
                        new Object[] {"Razer Ferox 2013 (RZ05-00500200-R3G2)"},
                };
    }

    @Test (dataProvider = "searchProduct")
    public void searchProduct(String product)
    {
        HomePage homePage = new HomePage(driver);
        homePage.open();
        homePage.searchProduct(product);
        Assert.assertTrue(homePage.productOnPage(product), ReportWriter.error("Search product test is FAILED"));
    }
}
